<crm-main-nav  nav-c="client" page-title="批量录入"></crm-main-nav>
  <!-- 面包屑 -->
<div class="container">
	<ol class="breadcrumb">
		<li>CRM系统</li>
		<li>录入客户</li>
		<li class="active">批量录入</li>
	</ol>
</div>
  <!-- 内容 -->
<crm-panel title="公共信息">
	<div ng-controller="clientClientBatchController">
	    <form class="form-horizontal" role="form" name="client_batch_form" ng-submit="clientBatchForm(client_batch_form.$valid)" novalidate>
			<div class="alert alert-danger" role="alert">提示：在批量录入信息时，不需要填写全部的行，但请确保每行信息内容填写完整和由上到下不能出现空行！ 录入前，请互相沟通好，避免重复录入！
			</div>
			<!-- <div class="form-group">
				<label class="col-sm-1 control-label">分公司：</label>
				<div class="col-sm-2">
					<company-select current-id="formData.branch_company_id"></company-select>
				</div>
				<label class="col-sm-1 control-label">渠道经理：</label>
				<div class="col-sm-2">
					<user-select current-id="formData.channel_manager_id" company-id="{{formData.branch_company_id}}"></user-select>
				</div>
				<label class="col-sm-1 control-label">咨询师：</label>
				<div class="col-sm-2">
					<user-select current-id="formData.consultant_id" company-id="{{formData.branch_company_id}}"></user-select>
				</div>
			</div> -->
			<div class="form-group">
				<label class="col-sm-1 control-label">学校：</label>
				<div class="col-sm-2" ng-class="{'has-error':!client_batch_form.school.$valid && (!client_batch_form.$pristine || client_batch_form.$submitted)}">
					<input type="text" class="form-control" name="school" ng-model="formData.school">
				</div>
				<label class="col-sm-1 control-label">专业：</label>
				<div class="col-sm-2" ng-class="{'has-error':!client_batch_form.major.$valid && (!client_batch_form.$pristine || client_batch_form.$submitted)}">
					<input type="text" class="form-control" name="major" ng-model="formData.major">
				</div>
				<label class="col-sm-1 control-label">毕业年份：</label>
				<div class="col-sm-2" date-input style-date="YYYY">
				</div>
			</div>	
	        <div class="form-group">
				<info-source dependents="formData.info_source" name="info_source"></info-source>
	        </div>	    
			<hr>
			<table class="table">
				<thead>
					<tr>
						<th width="200">姓&nbsp;名</th>
						<th width="120">性&nbsp;别</th>
						<th width="120">年&nbsp;龄</th>
						<th>手&nbsp;机</th>
						<th>Q&nbsp;Q</th>
						<th>编&nbsp;辑</th>
					</tr>
				</thead>
				<tbody>
					<tr ng-repeat="k in addClientBatchData track by $index">
						<td ng-class="{'has-error':!client_batch_form.name.$valid && (!client_batch_form.$pristine || client_batch_form.$submitted)}">
							<input type="text" class="form-control" name="name" ng-model="k.name" ng-pattern="/^[\u4e00-\u9fa5a-zA-Z]{2,}$/" required>
						</td>
						<td>
							<select name="sex" id="" class="form-control" ng-model="k.sex" required>
								<option value="">请选择</option>
								<option value="1">男</option>
								<option value="0">女</option>
							</select>
						</td>
						<td ng-class="{'has-error':!client_batch_form.age.$valid && (!client_batch_form.$pristine || client_batch_form.$submitted)}">
							<input type="text" class="form-control" name="age" ng-model="k.age" ng-pattern="/\d/" required>
						</td>
						<td ng-class="{'has-error':!client_batch_form.phone.$valid && (!client_batch_form.$pristine || client_batch_form.$submitted)}">
							<input type="text" class="form-control" name="phone" ng-model="k.phone" ng-pattern="/^1(3|4|5|7|8)\d{9}$/" required>
						</td>
						<td ng-class="{'has-error':!client_batch_form.qq.$valid && (!client_batch_form.$pristine || client_batch_form.$submitted)}">
							<input type="text" class="form-control" name="qq" ng-minlength="5" ng-model="k.qq">
						</td>
						<td>
							<button type="button" class="btn btn-danger" ng-click="delClientBatch(k)">删除</button>
							<button type="button" class="btn btn-info" ng-click="addClientBatch()">添加</button>
						</td>
					</tr>
				</tbody>
			</table>
			<div class="form-group">
				<div class="col-sm-offset-5 col-sm-7">
					<button type="submit" class="btn btn-primary">提交</button>
					<button type="reset" class="btn btn-primary">重置</button>
				</div>
			</div>
	    </form>
    </div>
</crm-panel>
